<?php
class header_ad
{
	protected	$_id;
	protected	$_order = '5';
	protected	$_DBconn;
	protected	$_front_template;
	protected	$_view;
	protected   $_image_on = '0';
	protected   $_group = '5';
	
	public function __construct($view) 
	{
		$this->_front_template = Zend_Registry::get('front_template'); 
		$this->_view =	$view;
		
		$helper_path = $this->_view->getHelpers();
		$doc_view = $helper_path[Doctype]->view;
		$catInfo = $doc_view->catInfo;
		$this->_id = ($catInfo['id'])? $catInfo['id'] : '13';
		
		//DB Connection
		$this->_DBconn = Zend_Registry::get('msqli_connection');
		$this->_DBconn->getConnection();
                $this->translator  = Zend_Registry::get('translator');
	}
	
	public function truncate($phrase,$start_words, $max_words)
	{
	   $phrase_array = explode(' ',$phrase);
	   if(count($phrase_array) > $max_words && $max_words > 0)
		  $phrase = implode(' ',array_slice($phrase_array, $start_words, $max_words)).'...';  
	   return $phrase;
	}
	
	public function class_body()
	{
		$translator = Zend_Registry::get('translator');
?>
<span class="contact-person"><span class="icon"></span><h1><?php echo $translator->translator('contact_person','','', $this->_front_template['theme_folder']); ?></h1></span>
<span class="contact-massage"><h6><?php echo $translator->translator('contact_person_massage','','', $this->_front_template['theme_folder']); ?></h6></span>
	
	<?php
	}
}

$header_ad_class = new header_ad($this);
try
{
	$header_ad_class->class_body();
}
catch(Exception $e)
{
	echo 'You have to create menu first.';
}
?>
